import request from "@/utils/request";
import { AxiosPromise } from "axios";
import { OrderListQuery, OrderListPageResult } from "./types";

const data = {
  page: 1,
  size: 100,
  dateStart: "2024-03-10T13:47:18.296Z",
  dateEnd: "2024-03-21T13:47:18.296Z",
  bizName: "",
  bizPrice: null,
  bizID: "",
  bizNo: "",
  bizType: "",
};
/**
 * 获取码分页数据
 *
 * @param queryParams
 */
export function getOrderListPage(
  queryParams?: OrderListQuery
): AxiosPromise<OrderListPageResult> {
  return request({
    url: "api/Order/GetOrderList",
    method: "post",
    data: queryParams,
    // data: data,
  });
}

/**
 * 获取码分页数据
 *
 * @param queryParams
 */
export function exportOrderListPage(
  queryParams?: OrderListQuery
): AxiosPromise<OrderListPageResult> {
  return request({
    url: "api/Order/OrderExport",
    method: "post",
    responseType: "blob",
    data: queryParams,
    // data: data,
  });
}

/**
 * 获取码下拉数据
 *
 * @param queryParams
 */
export function getOrderListOptions(
  queryParams?: OrderListQuery
): AxiosPromise<OptionType[]> {
  return request({
    url: "/api/v1/roles/options",
    method: "get",
    params: queryParams,
  });
}
